Long Test ^^^^^ **Definition:** * A Long Test is a test that consists of lot of code and statements. Such tests are mostly (but not necessarily) complex and badly document the purpose of the test and the application code. Furthermore they tend to test too much functionality, maybe even getting eager. **Also Known As:** * Obscure Test **Code Example:** .. code-block:: ruby # Subject under test class Stack def initialize @items = [] end def push(item) @items << item end def pop @items.pop end def peek @items.last end def depth @items.size end end # Test class Long < SmellTest def test_make_sure_everything_works subject = Stack.new # Test Push subject.push("A") subject.push("B") subject.push("C") assert_equal "C", subject.pop assert_equal "B", subject.pop assert_equal "A", subject.pop # Test Peek subject.push("D") subject.push("E") assert_equal "E", subject.peek subject.pop assert_equal "D", subject.peek subject.pop # Test Depth subject.push("F") subject.push("G") assert_equal 2, subject.depth # Test Pop subject.pop subject.pop assert_equal 0, subject.depth assert_equal nil, subject.pop end end **References:** .. admonition:: Quality attributes * :octicon:`file-code;1em` - Code Example * :octicon:`comment-discussion;1em` - Cause and Effect * :octicon:`graph;1em` - Frequency * :octicon:`sync;1em` - Refactoring * `A workbook repository of example test smells and what to do about them `_ :octicon:`file-code;1em` :octicon:`comment-discussion;1em` :octicon:`sync;1em` * `Assessing test quality ‐ TestLint `_ :octicon:`file-code;1em` :octicon:`comment-discussion;1em` * `Categorising Test Smells `_ :octicon:`graph;1em` * `Detection of test smells with basic language analysis methods and its evaluation `_ :octicon:`comment-discussion;1em` :octicon:`graph;1em` * `Rule-based Assessment of Test Quality `_ :octicon:`graph;1em` * `Test Smell Detection Tools: A Systematic Mapping Study `_